/************************************************
 * Author       :   XXY
 * Blog         :   https://www.cnblogs.com/jzyl
 * Gitee        :   https://gitee.com/xiaobaichong
 * Email        :   1047185209@QQ.com
 * FileName     :   IEntity.cs
 * CreateData   :   2023/4/28 16:59:21
 * UnityVersion :   2020.3.33f1c2
 * Description  :   实体接口
************************************************/

using Main;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace Hotfix
{
    /// <summary>
    /// 实体即为容器(个体)
    /// 实体接口
    /// </summary>
    internal interface IEntity
    {
        /// <summary>
        /// 该实体添加组件
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        ComponentBase AddComponent(ComponentBase component);
        /// <summary>
        /// 获取实体拥有的组件
        /// </summary>
        /// <typeparam name="T">要移除组件类型</typeparam>
        /// <returns></returns>
        T GetComponent<T>() where T : ComponentBase;
        /// <summary>
        /// 给实体添加组件并初始化
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="componentIDE"></param>
        /// <returns></returns>
        T AddComponent<T>(ComponentIDE componentIDE) where T : ComponentBase;
        /// <summary>
        /// 给实体添加组件并初始化
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="variablesIDE"></param>
        /// <returns></returns>
        T AddComponent<T>(VariablesIDE variablesIDE) where T : ComponentBase;
        /// <summary>
        /// 删除实体内的组件
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        bool RemoveComponent<T>();

        /// <summary>
        /// 给实体添加系统 (实体需Enable才可以添加系统)
        /// </summary>
        /// <param name="system"></param>
        /// <returns></returns>
        T AddSystem<T>() where T : SystemBase;
        /// <summary>
        /// 移除实体上的系统
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        bool RemoveSystem<T>() where T : SystemBase;
        /// <summary>
        /// 获取实体拥有的系统
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        T GetSystem<T>() where T : SystemBase;
    }
}